#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/ant.mk
include /usr/share/cdbs/1/rules/patchsys-quilt.mk

JAVA_HOME_DIRS       := /usr/lib/jvm/java-6-openjdk
DEB_ANT_BUILDFILE    := build.xml
DEB_ANT_BUILD_TARGET := jar javadoc
DEB_ANT_CLEAN_TARGET := realclean
DEB_JARS := ant-nodeps.jar

debian/stamp-ant-build: debian/stamp-jblas-build
debian/stamp-jblas-build:
	./configure --libpath=/usr/lib:/usr/lib/atlas
	touch $@

install/jblas::
	install -m644 -D bin/libjblas.so debian/jblas/usr/lib/jni/libjblas.so
	install -m644 -D jblas.jar debian/jblas/usr/share/java/jblas-$(DEB_UPSTREAM_VERSION).jar
	dh_link -pjblas /usr/share/java/jblas-$(DEB_UPSTREAM_VERSION).jar /usr/share/java/jblas.jar

install/jblas-doc:: debian/stamp-install-jblas-doc
debian/stamp-install-jblas-doc:
	#install javadoc javadoc
	install -m755 -d debian/jblas-doc/usr/share/doc/jblas-doc
	cp -r javadoc debian/jblas-doc/usr/share/doc/jblas-doc/
	touch $@

get-orig-source:
	-uscan --rename --upstream-version 0
	@echo successfully retrieved upstream tarball
